package com.sofaguest.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sofaguest.entry.SofaResult;
import com.sofaguest.service.LoginService;

@RequestMapping("/login")
@Controller
public class LoginController {

    @Resource
    private LoginService login;

    @ResponseBody
    @RequestMapping("/login.do")
    public SofaResult logIn(String userName, String passWord) {
        return login.login(userName, passWord);
    }

    @ResponseBody
    @RequestMapping("/register.do")
    public SofaResult register(String userId, String pwd, String realName, String sex, String certNum, String linkTel,
            String mail, String userType) {
        return login.register(userId, pwd, realName, sex, certNum, linkTel, mail, userType);
    }

    @ResponseBody
    @RequestMapping("/modifyUserInfo.do")
    public SofaResult modifyUserInfo(String userId, String certNum, String sex, String linkTel, String mail, String pwd) {
        return login.modifyUserInfo(userId, certNum, sex, linkTel, mail, pwd);
    }

    @ResponseBody
    @RequestMapping("/modifyPwd.do")
    public SofaResult modifyPwd(String userId, String oldPwd, String newPwd) {
        return login.modifyPwd(userId, oldPwd, newPwd);
    }

    @ResponseBody
    @RequestMapping("/qryUser.do")
    public SofaResult qryUser(String byTimeTag) {
        return login.qryUser(byTimeTag);
    }

    @ResponseBody
    @RequestMapping("/managerInfo.do")
    public SofaResult managerInfo(String id, String type, String acctId) {
        return login.managerInfo(id, type, acctId);
    }
}
